package com.szxy.hotel.service;

import com.szxy.hotel.entity.Hotelroom;
import com.szxy.hotel.entity.Room;
import com.szxy.hotel.mapper.HotelroomMapper;
import com.szxy.hotel.mapper.RoomMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("reserveService")
public class ReserveService {
    @Resource
    RoomMapper roomMapper;
    @Resource
    HotelroomMapper hotelroomMapper;

    public List<Hotelroom> selectAddType(String roomtype) {
        return hotelroomMapper.selectAddType(roomtype);
    }

    public Hotelroom findByhotelroomid(String roomId) {
        return hotelroomMapper.findByhotelroomid(roomId);
    }

    public int insertRoom(Room room) {
        return roomMapper.insertRoom(room);
    }

    public void updateHotelstate(String roomId, String roomState) {
        hotelroomMapper.updateHotelstate(roomId,roomState);
    }

    public Room findByroomid(String roomId) {
        return roomMapper.findByroomid(roomId);
    }

    public void updateDate(Room room) {
        roomMapper.updateDate(room);
    }

    public List<Room> findByPage(int start, int size,String roomtype) {
        return roomMapper.findByPage(start,size,roomtype);
    }

    public List<Room> selectCount(String roomtype) {
        return roomMapper.selectCount(roomtype);
    }

    public List<Room> findByPageSearch(int start, int size, String roomtype, String userName3) {
        return roomMapper.findByPageSearch(start,size,roomtype,userName3);
    }

    public List<Room> selectCountSearch(String roomtype,String userName3) {
        return roomMapper.selectCountSearch(roomtype,userName3);
    }

    public int deleteReserve(String roomId, String rs) {
        return roomMapper.deleteReserve(roomId,rs);
    }

    public List<Room> findByPageSelectid(int start, int size, String roomtype, String selectroomid) {
        return roomMapper.findByPageSelectid(start,size,roomtype,selectroomid);
    }

    public List<Room> selectCountSelectid(String roomtype, String selectroomid) {
        return roomMapper.selectCountSelectid(roomtype,selectroomid);
    }
}
